package com.binyouwei.calculator.ui

import android.util.Log
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.navigation.NavHostController
import androidx.navigation.compose.rememberNavController
import com.binyouwei.calculator.widget.MyButton

/**
 * @author 宾有为
 * @date 2025/3/21 17:07
 * @link https://blog.csdn.net/baidu_41616022?type=blog
 * @describe：
 **/

@Preview
@Composable
fun MainScreen(nav: NavHostController = rememberNavController()) {
    Box(modifier = Modifier
        .fillMaxSize()) {
        Column(modifier = Modifier.align(Alignment.Center)) {
            MyButton("计算器", onConfirmClick = {
                Log.d("MainScreen", "MainScreen: 计算器")
                nav.navigate(AppPage.Calculator.name)
            })
        }
    }
}